package com.njxxted.activiti.modules.process.extend.controller;

import com.njxxted.activiti.common.response.ResponseVo;
import com.njxxted.activiti.modules.base.controller.BaseController;
import com.njxxted.activiti.modules.process.extend.entity.HistoryTaskInstanceEntity;
import com.njxxted.activiti.modules.process.extend.service.ExtendActHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * 描述：流程历史扩展 Controller
 * <p>
 * 作者：HuTongFu
 * 邮箱：hu_tongfu@163.com
 * 时间：2019-08-12 16:58:12
 */
@Api(tags = "流程历史扩展")
@RestController
@RequestMapping(value = "/act/rest/extend/history")
public class ExtendActHistoryController extends BaseController {

    @Resource
    private ExtendActHistoryService extendActHistoryService;

    @ApiOperation(value = "流程任务节点历史")
    @GetMapping(value = "/{instanceId}")
    public ResponseVo getActTaskHistory(@PathVariable String instanceId) {
        List<HistoryTaskInstanceEntity> workFlowHistory = extendActHistoryService.getActTaskHistory(instanceId);
        return ResponseVo.ok(workFlowHistory);
    }

}
